﻿using SEIPropertyDataService.Entity.Enums;
using SqlSugar;
using System;
using System.Collections.Generic;

namespace SEIPropertyDataService.Entity.Models
{
    /// <summary>
    /// 角色信息
    /// </summary>
    [SugarTable("role")]
    public class RoleModel
    {
        /// <summary>
        /// 角色ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true)]
        public string Id { get; set; }
        /// <summary>
        /// 角色名称
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public string Name { get; set; }
        /// <summary>
        /// 功能代码，多个功能使用位运算 | 组合
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public Functions FunctionCode { get; set; }
        /// <summary>
        /// 角色描述
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string Description { get; set; }
        /// <summary>
        /// 是否默认角色
        /// </summary>
        [SugarColumn(IsNullable = false, DefaultValue = "0")]
        public int IsDefault { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(IsNullable = false, IsOnlyIgnoreUpdate = true)]
        public DateTime CreatedTime { get; set; }
        /// <summary>
        /// 功能列表
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public List<string>? FunctionArr { get; set; }
    }
}
